/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pie4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */
package com.pie4cloud.pie.bus.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.pie4cloud.pie.common.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * kafka消费者管理
 *
 * @author pie code generator
 * @date 2021-12-28 10:59:58
 */
@Data
@TableName("data_kaf_consumer")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "kafka消费者管理")
@Entity
@Table(name = "DATA_KAF_CONSUMER")
public class DataKafConsumer extends BaseEntity {

    /**
     * consId
     */
    @Id
	@TableId(value = "CONS_ID", type = IdType.ASSIGN_ID)
	@GenericGenerator(name="snowflakeId", strategy="com.pie4cloud.pie.jpa.id.GenerateSnowflakeId")
	@GeneratedValue(generator="snowflakeId")
    @ApiModelProperty(value="consId")
	@Column(name = "CONS_ID",length = 11)
	private Long consId;

	@Column(name = "TOPIC",length = 255)
	@ApiModelProperty(value="topic")
	private String topic;

    /**
     * 消费组
     */
	@Column(name = "KAF_GROUP",length = 50)
	@ApiModelProperty(value="消费组")
    private String kafGroup;

    /**
     * 服务名称
     */
    @ApiModelProperty(value="服务名称")
	@Column(name = "SERVICE_NAME",length = 50)
	private String serviceName;

    /**
     * 执行handler
     */
    @ApiModelProperty(value="执行handler")
	@Column(name = "HANDLER",length = 50)
	private String handler;

    /**
     * 执行线程
     */
    @ApiModelProperty(value="执行线程")
	@Column(name = "WORK_NUM",length = 11)
	private Integer workNum;

    /**
     * 启动时间
     */
    @ApiModelProperty(value="消费时间")
	@Column(name = "CONSUMPTION_TIME",length = 11)
	private Date consumptionTime;

    /**
     * 排序
     */
	@Column(name = "SORT",length = 11,columnDefinition = "INTEGER default 0")
	@ApiModelProperty(value="排序")
    private Integer sort;

    /**
     * 是否删除  -1：已删除  0：正常
     */
    @ApiModelProperty(value="是否删除  -1：已删除  0：正常")
	@Column(name = "DEL_FLAG",length = 1,columnDefinition = "VARCHAR(1) DEFAULT '0'")
	private String delFlag;

	@ApiModelProperty(value="是否启动  0：停止  1：运行")
	@Column(name = "TRIGGER_STATUS",length = 11,columnDefinition = "INTEGER default 0")
	private Integer triggerStatus;

	@Transient
	@TableField(exist = false)
	private long lastTotalLag = 0L;


}
